package com.gt.xmall.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.gt.xmall.model.GtdContext;
import com.gt.xmall.repository.GtdContextDao;

@Component
@Transactional(readOnly = true)
public class GtdContextService extends BaseService{
	@Autowired
	private GtdContextDao gtdContextDao;
	

	public List<GtdContext> getGtdContexts(){
		return (List<GtdContext>)gtdContextDao.findAll();
	}
	
	public GtdContext getGtdContext(Long id){
		return gtdContextDao.findOne(id);
	}
	@Transactional(readOnly = false)
	public GtdContext saveGtdContext(GtdContext gtdContext){
		return gtdContextDao.save(gtdContext);
	}
	
	@Transactional(readOnly = false)
	public void deleteGtdContext(GtdContext gtdContext){
		 gtdContextDao.delete(gtdContext);
		 
	}
}
